package org.example.gradleauth.feigns.service;

import org.example.gradleauth.feigns.fallback.GradleAdminFallbackFactory;
import gradle.common.core.mode.entity.SystemPermissions;
import gradle.common.core.mode.entity.SystemUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "gradle-admin", fallbackFactory = GradleAdminFallbackFactory.class)
public interface GradleAdminFeignClient {

	@GetMapping("/service/user/loadUserByUsername")
	SystemUser loadUserByUsername(@RequestParam("username") String username);

	@GetMapping("/service/permissions/queryIdListPermByUserId")
	List<Long> queryIdListPermByUserId(@RequestParam("id") Long id);

	@GetMapping("/service/permissions/queryPermAll")
	List<SystemPermissions> queryPermAll();
}